<?php

	include("common.php");
	
	$result = mysql_query("SELECT * FROM `197_albums` WHERE `album_id` = " . $_GET['album_id']);
	$album = mysql_fetch_assoc($result);
	$dir_name = $album['dir_name'];
	rrmdir("../files/" . $dir_name);
	
	mysql_query("DELETE FROM `197_albums` WHERE `album_id` = " . $_GET['album_id']);
	mysql_query("DELETE FROM `197_photos` WHERE `album_id` = " . $_GET['album_id']);

?>
<?php include("header.php"); ?>
<?php if(!AJAX){ ?><h1>刪除相簿</h1><?php } ?>
<p>刪除成功<?php if(!AJAX){ ?>，請<a href="albumFind.php">按此</a>返回<?php } ?>。</p>
<?php include("sidebar.php"); ?>
<?php include("footer.php"); ?>